package com.navi.core.mysqlEntity;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.sql.Timestamp;

public class SpcRetChartDataEntityPK implements Serializable {
    private String colTypFk;
    private String grpNoFk;
    private String chartNoFk;
    private String chartTypFk;
    private double inputTimeD;
    private Timestamp inputTimestamp;

    @Column(name = "COL_TYP_FK")
    @Id
    public String getColTypFk() {
        return colTypFk;
    }

    public void setColTypFk(String colTypFk) {
        this.colTypFk = colTypFk;
    }

    @Column(name = "GRP_NO_FK")
    @Id
    public String getGrpNoFk() {
        return grpNoFk;
    }

    public void setGrpNoFk(String grpNoFk) {
        this.grpNoFk = grpNoFk;
    }

    @Column(name = "CHART_NO_FK")
    @Id
    public String getChartNoFk() {
        return chartNoFk;
    }

    public void setChartNoFk(String chartNoFk) {
        this.chartNoFk = chartNoFk;
    }

    @Column(name = "CHART_TYP_FK")
    @Id
    public String getChartTypFk() {
        return chartTypFk;
    }

    public void setChartTypFk(String chartTypFk) {
        this.chartTypFk = chartTypFk;
    }

    @Column(name = "INPUT_TIME_D")
    @Id
    public double getInputTimeD() {
        return inputTimeD;
    }

    public void setInputTimeD(double inputTimeD) {
        this.inputTimeD = inputTimeD;
    }

    @Column(name = "INPUT_TIMESTAMP")
    @Id
    public Timestamp getInputTimestamp() {
        return inputTimestamp;
    }

    public void setInputTimestamp(Timestamp inputTimestamp) {
        this.inputTimestamp = inputTimestamp;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SpcRetChartDataEntityPK that = (SpcRetChartDataEntityPK) o;

        if (Double.compare(that.inputTimeD, inputTimeD) != 0) return false;
        if (colTypFk != null ? !colTypFk.equals(that.colTypFk) : that.colTypFk != null) return false;
        if (grpNoFk != null ? !grpNoFk.equals(that.grpNoFk) : that.grpNoFk != null) return false;
        if (chartNoFk != null ? !chartNoFk.equals(that.chartNoFk) : that.chartNoFk != null) return false;
        if (chartTypFk != null ? !chartTypFk.equals(that.chartTypFk) : that.chartTypFk != null) return false;
        if (inputTimestamp != null ? !inputTimestamp.equals(that.inputTimestamp) : that.inputTimestamp != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result;
        long temp;
        result = colTypFk != null ? colTypFk.hashCode() : 0;
        result = 31 * result + (grpNoFk != null ? grpNoFk.hashCode() : 0);
        result = 31 * result + (chartNoFk != null ? chartNoFk.hashCode() : 0);
        result = 31 * result + (chartTypFk != null ? chartTypFk.hashCode() : 0);
        temp = Double.doubleToLongBits(inputTimeD);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        result = 31 * result + (inputTimestamp != null ? inputTimestamp.hashCode() : 0);
        return result;
    }
}
